package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.ElementBusiSrtpQoslspMapper;
import com.ruoyi.net.domain.ElementBusiSrtpQoslsp;
import com.ruoyi.net.service.IElementBusiSrtpQoslspService;

/**
 * 网元-业务-SRTP-qoslspService业务层处理
 * 
 * @author net
 * @date 2024-12-05
 */
@Service
public class ElementBusiSrtpQoslspServiceImpl implements IElementBusiSrtpQoslspService 
{
    @Autowired
    private ElementBusiSrtpQoslspMapper elementBusiSrtpQoslspMapper;

    /**
     * 查询网元-业务-SRTP-qoslsp
     * 
     * @param id 网元-业务-SRTP-qoslsp主键
     * @return 网元-业务-SRTP-qoslsp
     */
    @Override
    public ElementBusiSrtpQoslsp selectElementBusiSrtpQoslspById(String id)
    {
        return elementBusiSrtpQoslspMapper.selectElementBusiSrtpQoslspById(id);
    }

    /**
     * 查询网元-业务-SRTP-qoslsp列表
     * 
     * @param elementBusiSrtpQoslsp 网元-业务-SRTP-qoslsp
     * @return 网元-业务-SRTP-qoslsp
     */
    @Override
    public List<ElementBusiSrtpQoslsp> selectElementBusiSrtpQoslspList(ElementBusiSrtpQoslsp elementBusiSrtpQoslsp)
    {
        return elementBusiSrtpQoslspMapper.selectElementBusiSrtpQoslspList(elementBusiSrtpQoslsp);
    }

    /**
     * 新增网元-业务-SRTP-qoslsp
     * 
     * @param elementBusiSrtpQoslsp 网元-业务-SRTP-qoslsp
     * @return 结果
     */
    @Override
    public int insertElementBusiSrtpQoslsp(ElementBusiSrtpQoslsp elementBusiSrtpQoslsp)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementBusiSrtpQoslsp.getId())) {
            elementBusiSrtpQoslsp.setId(uuid);
        }
        elementBusiSrtpQoslsp.setCreateBy(SecurityUtils.getUsername());
        elementBusiSrtpQoslsp.setCreateTime(DateUtils.getNowDate());
        elementBusiSrtpQoslsp.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpQoslsp.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpQoslspMapper.insertElementBusiSrtpQoslsp(elementBusiSrtpQoslsp);
    }

    /**
     * 修改网元-业务-SRTP-qoslsp
     * 
     * @param elementBusiSrtpQoslsp 网元-业务-SRTP-qoslsp
     * @return 结果
     */
    @Override
    public int updateElementBusiSrtpQoslsp(ElementBusiSrtpQoslsp elementBusiSrtpQoslsp)
    {
        elementBusiSrtpQoslsp.setUpdateBy(SecurityUtils.getUsername());
        elementBusiSrtpQoslsp.setUpdateTime(DateUtils.getNowDate());
        return elementBusiSrtpQoslspMapper.updateElementBusiSrtpQoslsp(elementBusiSrtpQoslsp);
    }

    /**
     * 批量删除网元-业务-SRTP-qoslsp
     * 
     * @param ids 需要删除的网元-业务-SRTP-qoslsp主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpQoslspByIds(String[] ids)
    {
        return elementBusiSrtpQoslspMapper.deleteElementBusiSrtpQoslspByIds(ids);
    }

    /**
     * 删除网元-业务-SRTP-qoslsp信息
     * 
     * @param id 网元-业务-SRTP-qoslsp主键
     * @return 结果
     */
    @Override
    public int deleteElementBusiSrtpQoslspById(String id)
    {
        return elementBusiSrtpQoslspMapper.deleteElementBusiSrtpQoslspById(id);
    }
}
